package com.example.broadcast;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;

public class MyReceiver extends BroadcastReceiver{
    public MyReceiver(){

    }

    @Override
    public void onReceive(Context context, Intent intent) {
        // TODO: This method is called when the BroadcastReceiver is receiving
        // an Intent broadcast.
        //throw new UnsupportedOperationException("Not yet implemented");
        String outnumber = getResultData();
        SharedPreferences sp = context.getSharedPreferences("config",Context.MODE_PRIVATE);
        String number = sp.getString("number","");
        if(outnumber.equals(number)){
            setResultData(null);
        }
    }
}
